﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/OneColumn.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="Quizz.Infrastructure" %>
<%@ Import Namespace="Quizz.Library.Helper" %>
<%@ Import Namespace="Quizz.Library.QuizzServiceReference" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">
    <% if (!AccessFactory.IsUserLogined())
       {
           Html.RenderPartial("../UserControls/RegisterBox");
           Html.RenderPartial("../UserControls/LoginBox");
       }
       else
       {
           var user = AccessFactory.CurrentUser;
    %>
       <div class="user-info" style="width: 400px;">
        <span class="title">Thông tin người dùng</span>
        <hr class="h-line-dashed"/>
        <img class="avatar" alt="<%= user.Email %>" src="<%=  string.IsNullOrEmpty(user.Avartar)? AccessFactory.DefaultAvatar: AccessFactory.AvartarFolder + user.Avartar %>" />
        <div class="item">Xin chào <a href="/Account/EditUser/<%= user.Id %>" class="impress"><%= user.FirstName %> <%= user.LastName %></a> !</div>
        <div class="item"><span class="italic-small">Đăng nhập lúc <%= ((LoginLog)ViewData[Constants.LastLoginLog]).LoginTime.ToString("H:mm:ss dd/MM/yyyy")%></span></div>
        <div class="item">Email <%= user.Email %></div>
        <div class="item link-button" ><a href="javascript:void(0);" style="width: 120px; height:20px;" onclick="javascript:logout();">Thoát</a></div>
       </div>
       <% } %>
    <div class="clear"></div>
</asp:Content>

<asp:Content ID="content3" ContentPlaceHolderID="otherResourcePlace" runat="server">
    
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="headerContentPlace" runat="server">
    <script type="text/javascript" src="/Scripts/SHA256.js"></script>
</asp:Content>